<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<title></title>
		<style>
			* {
				margin: 0;
				padding: 0;
			}

			html,
			body {
				height: 100%;
			}

			#container {
				min-height: 100%;
			}

			#main {
				overflow: auto;
				padding-bottom: 50px;
			}

			.fiexd {
				position: fixed;
				top: 80px;
			}

			#footer {
				background-color: rgba(0, 0, 0, 0.5);
				position: fixed;
				left: 0;
				bottom: 0;
				height: 50px;
				width: 100%;
				z-index: 9999;
			}

			table td,
			th {

				padding: 10px 30px;

				border-bottom: 1px solid #999;

				border-right: 1px solid #999;

			}

			table {

				border-top: 1px solid #999;

				border-left: 1px solid #999;

				border-spacing: 0;
				/*去掉单元格间隙*/

			}
		</style>
		<style>
			#loading-mask {
				position: fixed;
				left: 0;
				top: 0;
				height: 100%;
				width: 100%;
				background: #fff;
				user-select: none;
				z-index: 9999;
				overflow: hidden
			}

			.loading-wrapper {
				position: absolute;
				top: 50%;
				left: 50%;
				transform: translate(-50%, -100%)
			}

			.loading-dot {
				animation: antRotate 1.2s infinite linear;
				transform: rotate(45deg);
				position: relative;
				display: inline-block;
				font-size: 64px;
				width: 64px;
				height: 64px;
				box-sizing: border-box
			}

			.loading-dot i {
				width: 22px;
				height: 22px;
				position: absolute;
				display: block;
				background-color: #1890ff;
				border-radius: 100%;
				transform: scale(.75);
				transform-origin: 50% 50%;
				opacity: .3;
				animation: antSpinMove 1s infinite linear alternate
			}

			.loading-dot i:nth-child(1) {
				top: 0;
				left: 0
			}

			.loading-dot i:nth-child(2) {
				top: 0;
				right: 0;
				-webkit-animation-delay: .4s;
				animation-delay: .4s
			}

			.loading-dot i:nth-child(3) {
				right: 0;
				bottom: 0;
				-webkit-animation-delay: .8s;
				animation-delay: .8s
			}

			.loading-dot i:nth-child(4) {
				bottom: 0;
				left: 0;
				-webkit-animation-delay: 1.2s;
				animation-delay: 1.2s
			}

			@keyframes antRotate {
				to {
					-webkit-transform: rotate(405deg);
					transform: rotate(405deg)
				}
			}

			@-webkit-keyframes antRotate {
				to {
					-webkit-transform: rotate(405deg);
					transform: rotate(405deg)
				}
			}

			@keyframes antSpinMove {
				to {
					opacity: 1
				}
			}

			@-webkit-keyframes antSpinMove {
				to {
					opacity: 1
				}
			}
		</style>
		<script src="./js/dsbride.js"></script>
		<script>
			let webSocket = new WebSocket("ws://192.168.0.102:8881/crNursing/api/myWs1");
			webSocket.onopen = function(){
				webSocket.send("我是客户端")
			}
			webSocket.onmessage = function(message){
				console.log(`我收到了消息==${message.data}`)
			}
			/* var barHeight = null
			document.addEventListener('plusready', function() {
				//console.log("所有plus api都应该在此事件发生后调用，否则会出现plus is undefined。")
				barHeight = plus.navigator.getStatusbarHeight()
			}); 
			function cardInfo(data) {
				alert(data)
			}

			function cardInfoError(data) {
				alert(data)
			}

			function startRecord() {
				// let ua = window.navigator.userAgent;
				var result = window.dsBridge.hasNativeMethod('scanIdCard')
				alert("startRecord=" + result)
				// bridge.call("startRecorrd", "", function(value) {
				// 	alert("startRecord=" + value)
				// 	document.getElementById("audio").setAttribute("accept", "selectaudio/*" + value)
				// })
			}*/
			function closePage() {
				alert("aa");
				window.history.go(-1);
				//window.location.href = "/CONSTANTS_GO_BACK#-1";
			}

			function stopRecord() {
				//bridge.call("stopRecord", "callAndroid")
				/* var json = {
					user: "admin",
					auth: "Bcy@22qw"
				}
				var str = JSON.stringify(json);
				//加密encodeURIcomponent
				var jiaMi = encodeURIComponent(str);
				alert(jiaMi); //结果为i%20love%E4%B8%AD%E5%9B%BD ，你会发现英文字母没有加密
				var jiaM = btoa(jiaMi);
				alert(jiaM); //结果为aSUyMGxvdmUlRTQlQjglQUQlRTUlOUIlQkQ=
				console.log(jiaM) */

				//解密，先用atob解密ascii码，然后再用decodeURIComponent
				var jieMi = atob("JTdCJTIydXNlciUyMiUzQSUyMjAwNDE4NCUyMiUyQyUyMmF1dGglMjIlM0ElMjIlMjIlN0Q=");
				alert("jie1==="+jieMi)
				var jieM = decodeURIComponent(jieMi);
				alert("jie2==="+jieM)
			}

			function getToken() {
				bridge.call("scanCode", "")
				//bridge.call("dsNewBride.scanCode","")
				//bridge.dsNewBride.scanCode()
				// bridge.call("getToken","asf",function(value){
				// 	alert(value)
				// })
				// let str = "document.body.barHeight=" + barHeight + "window.innerHeight=" +
				// 	window.innerHeight + "\ndocument.body.scrollHeight=" + document.body.scrollHeight +
				// 	"\nwindow.screen.height=" + window.screen.height + "window.screen.availHeight=" + window.screen.availHeight
				// alert(str)
				// bridge.call("getHeight","",function(value){
				// 	alert("height="+value)
				// 	document.getElementById("body").css("height",value+"px")
				// })
				//bridge.call("callAndroid", "callAndroid")
				//bridge.call("vibrator", "-1")
				// let item = "asdf"
				// let id = 11
				// let value = "<li><span>" + item + "</span><span><input type='button' value='选择' onclick='changeName(\"" + item +
				// 	"\")'/></span></li>"
				// document.getElementById("J_List").innerHTML = value
				// console.log("value=" + document.getElementById("J_List").innerHTML)
			}

			/* function changeName(name) {
				alert(name)
				//document.getElementById("filename").value=name
			}

			function takePic(name) {
				//alert(name)
				//document.getElementById("filename").value=name
			}
			window.onload = function() {
				bridge.call("getHeight", "", function(value) {
					alert("height=" + value)
					let item = document.getElementById("body")
					item.style.height = value + "px";
					item.style.backgroundColor = "red";
				})
			} */


			function setRed() {
				alert("value")
				//dsNewBride.click0('参数1', '参数2')
				//这个方法设置 id 为 ptext 的元素的背景色为红色  
				var a = document.getElementById('ptext');
				a.style.backgroundColor = "#F00";
			}

			function setColor(color, text) {
				//alert('ss')
				//这个方法设置 id 为 ptext 的元素的背景色为指定颜色  
				//设置 id 为 ptext 的元素的内容为text  
				var a = document.getElementById('ptext');
				a.style.backgroundColor = color;
				a.innerHTML = text;
			}

			function startAsyn() {
				console.log("xxxxxx")
				bridge.call("scanCodeAsyn", "test", function(param) {
					alert(param)
				})
			}

			function getContent() {
				alert(bridge.call('getIpAddress', 'aaab'))
			}

			let isLocationOk = false;
			window.onload = function() {
				//window.open("./js/pdfjs/web/viewer.html?file=移动协同签名服务端接口说明手册V2.0.5.pdf")
				alert('bridge=='+bridge)
				bridge.call("getGps", "", param=> {
					let location = JSON.parse(param)
					if(location.longitude && locatioin.latitude){
						alert("定位成功")
						isLocationOk=true;
						showLocation(`首次定位结果：${location.longitude}--${location.latitude}`)
					}else {
						alert("定位失败")
					}
				})
			}
			
			let timeInterval
			function getLocation(){
				if(!isLocationOk){
					alert("请等待首次定位成功结果")
					return;
				}
				if(timeInterval){
					clearInterval(timeInterval)
				}
				timeInterval = setInterval(()=>{
					bridge.call("getGps", "", param=> {
						let location = JSON.parse(param)
						showLocation(`轮询定位结果：${location.longitude}--${location.latitude}`)
					})
				},3000)
				
				// bridge.call("getLocationV2", "", function(param) {
				// 	alert("2=="+param)
				// })
				/* let has = bridge.hasNativeMethod("getGbps")
				if(has){
					alert('has======'+ (typeof has))
				}else{
					alert('im e')
				} */
			}
			
			function showLocation(content){
				document.getElementById("location").innerText = content;
			}
		</script>
	</head>
	<body id="body">b
		<!-- 动画节点 -->
		<!-- <div id="loading-mask">
			<div class="loading-wrapper">
				<span class="loading-dot loading-dot-spin"><i></i><i></i><i></i><i></i></span>
			</div>
		</div> -->
		<div style="width: 300px;display: flex;flex-direction: row;">
			<div style="flex:1;background-color: #0000FF;">aaaaaaa</div>
			<div style="flex: 1;background-color: #FF0000;"></div>
		</div>
		<!-- <div>
			<div style="background-color: #FF0000;width: 300px;height: 300px;position: absolute;z-index: 100;" onclick='alert("hha")'></div>
			<div style="background-color: fuchsia;width: 100px;height: 100px;position: relative;z-index: 101;" >aa</div>
		</div> -->
		<div id="container">
			<input style="width: auto;" />
			<div style="position: fixed;background-color: #FFFF00;">ffffffffffffffffffffff</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<button onclick="getLocation()">开启轮询获取定位</button>
			<div>定位值：</div>
			<div id="location"></div>
			<div class="fiexd">11111111111111111111111111111</div>
			<div style="width:100px;background-color: #FF0000;">asdfasdfasdfasdf44asdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<form>
				<input type="checkbox" name="anser" value="A" />A
				<input type="checkbox" name="anser" value="B" />B
				<input type="checkbox" name="anser" value="C" />C
				<button type="reset">重置</button>
				<input type="submit" />
			</form>
			<div style="display:flex;width: 200px;height: 200px;background-color: #0000FF;padding: 0px 50px 0px 50px;">
				<div style="display:flex;width: 100%;height: 100px;background-color: #FFFF00;"></div>
			</div>
			<div style="text-align: center;">
				<table border="0.5" cellpadding="10">
					<thead>
						<th></th>
						<th>星期一</th>
						<th>星期二</th>
						<th>星期三</th>
						<th>星期四</th>
						<th>星期五</th>
					</thead>
					<tbody>
						<tr>
							<td>第一节</td>
							<td>语文</td>
							<td>数学</td>
							<td>语文</td>
							<td>数学</td>
							<td>语文</td>
						</tr>
						<tr>
							<td>第二节</td>
							<td>语文</td>
							<td>数学</td>
							<td>语文</td>
							<td>数学</td>
							<td>语文</td>
						</tr>
						<tr>
							<td>第三节</td>
							<td>语文</td>
							<td>数学</td>
							<td>语文</td>
							<td>数学</td>
							<td>语文</td>
						</tr>
						<tr>
							<td></td>
							<td>主题班会</td>
							<td></td>
							<td>书法</td>
							<td>古典诵读</td>
							<td></td>
						</tr>
						<tr>
							<td colspan="6">午休</td>
						</tr>
						<tr>
							<td>第四节</td>
							<td>语文</td>
							<td>数学</td>
							<td>语文</td>
							<td>数学</td>
							<td>语文</td>
						</tr>
						<tr>
							<td>第五节</td>
							<td>语文</td>
							<td>数学</td>
							<td>语文</td>
							<td>数学</td>
							<td>语文</td>
						</tr>
						<tr>
							<td>第六节</td>
							<td>语文</td>
							<td>数学</td>
							<td>语文</td>
							<td>数学</td>
							<td>语文</td>
						</tr>
					</tbody>
				</table>
			</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasd666d</div>
			<div
				style="box-sizing: border-box; padding-top:50px;background-color: #FFFF00; width: 200px; height: 200px;display: flex;align-items: center;justify-content: center;">
				aa
			</div>
			<div style="background-color: #FFFF00; width: 200px; height: 200px;padding-top: 1px;margin-top: 50px;">
				<div
					style="background-color: #FF0000; width: 100px; height: 100px;padding-top: 1px;margin-top: 30px;position: relative;">
					<div
						style="background-color: #0000FF; width: 50px; height: 50px;margin-top: 20px;position: absolute;top: 10px;">
						aa
					</div>
				</div>
			</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<div>asdfasdfasdfasdfasdfasd</div>
			<!-- <input accept="selectfile/*" type="file" />
			<input id="audio" accept="selectaudio/*" type="file" />
			<div id="main" onclick="getToken()">
				<p>This is the content.</p>
			</div>
			<div onclick="startRecord()">
				<p>startRecorrd</p>
			</div>
			<input accept="takepic/*" type="file" />
			<input accept="takevideo/*" type="file" /> -->
			<div onclick="closePage()">
				<p>关闭页面</p>
			</div>
			<div onclick="stopRecord()">
				<p>stopRecordd</p>
			</div>
			<div>
				<input type="button" id="buttonId11" class="buttonClass" onclick="javascript:getContent()"
					value="同步获取内容" />
			</div>
			<div>
				<input type="button" id="buttonId1" class="buttonClass" onclick="javascript:getToken()"
					value="第三方通过android官方的方式" />
			</div>
			<div style="margin-top: 20px;">
				<a href="tel:12222" type="button" id="buttonId0"
					class="buttonClass">第三方通过shouldOverrideUrlLoading的方式</a>
			</div>
			<div style="margin-top: 20px;">
				<input id="pic" accept="image/*" type="file" title="takepic" value="第三方通过打开文件的方式"><a
					href="image://xxx"></a></input>
			</div>
			<div style="margin-top: 20px;">
				<input id="picc" accept="takePic/*" type="file" title="takepicc" value="第三方通过打开文件的方式" />
			</div>
			<div style="margin-top: 20px;">
				<input id="pizc" type="button" onclick="startAsyn()" value="第三方通过异步" />
			</div>

		</div>

		<div id="footer">
			<div style="color: white;">haaha</div>
		</div>

		<script>
			window.sdk = {
				setColor: (color, text) => {
					//alert('ss')
					//这个方法设置 id 为 ptext 的元素的背景色为指定颜色  
					//设置 id 为 ptext 的元素的内容为text  
					var a = document.getElementById('ptext');
					a.style.backgroundColor = color;
					a.innerHTML = text;
				}
			}
		</script>

	</body>
</html>
